const fileCache = require('think-cache-file');
const mysql = require('think-model-mysql');
const isDev = think.env === 'development';
const path = require('path');

module.exports = {
  type: 'mysql',
  common: {
    logConnect: isDev,
    logSql: isDev,
    logger: msg => think
      .logger
      .info(msg)
  },
  mysql: {
    handle: mysql,
    user: 'root',
    password: '1234',
    database: 'think_admin',
    host: '120.78.73.58',
    port: 3306,
    connectionLimit: 1,
    prefix: '',
    cache: {
      type: 'file',
      handle: fileCache,
      cachePath: path.join(think.ROOT_PATH, 'runtime/cache')
    }
  }
}
